#!/usr/bin/python
#coding=utf-8

import platform
import os
import sys
sys.path.append('../../')
import StrUtils
import pandas as pd
import yaml
import sample_data

if __name__ == '__main__':
    sysstr = platform.system()
    curpath = os.path.dirname(os.path.abspath(__file__))

    sample_data.load_iris_df()
    exit(0)

    x, y = 50, 25
    small = x if x < y else y
    print (small)

    csv_file = sample_data.get_data('vehicles_68000.csv')

    df = pd.read_csv(csv_file, dtype=str)
    print ('------------', len(df))
    print (df.head(20))
    exit(0)

    lst = ('a', 'b', 'c')
    for i, v in enumerate(lst):
        print (i, v)

    import pandas as pd

    dates = pd.to_datetime(pd.Series(['20010101', '20010331']), format = '%Y%m%d')
    date_list = dates.dt.strftime('%Y-%m-%d')
    print ('----------', date_list)
    '''
    import pandas as pd
    datelist = pd.date_range(pd.datetime.today(), periods=100).tolist()
    print ('----------', datelist)
    '''

    sysstr = platform.system()
    curpath = os.path.dirname(os.path.abspath(__file__))

    sr_filename = sample_data.get_data('yaml_example.yaml')
    status, sr_file = StrUtils.readFile(sr_filename, {})

    content = yaml.load(sr_file, Loader=yaml.BaseLoader, debug=True)

    print (content)
